﻿using System.Text.RegularExpressions;

namespace InfluxDB.Flurl
{
    internal partial class RegexHelper
    {
        private const string intPar = @"^-?\d+$";
#if NET8_0_OR_GREATER

        [GeneratedRegex(intPar, RegexOptions.Compiled, "en-us")]
        internal static partial Regex IsInt();

        public static bool ValidInt(string str) => IsInt().IsMatch(str);
#else
        public static bool ValidInt(string str)
        {
            return Regex.IsMatch(str, intPar);
        }
#endif
    }
}
